﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<script type="text/javascript">
    var formIndex = 0;
    $(document).ready(function () {
        $("#emailForm").validate({
            debug: false,
            errorElement: "span",
            errorPlacement: function (error, element) {
                error.tooltip({
                    bodyHandler: function () {
                        return error.html();
                    }
                });
                error.insertAfter(element);
            },
            rules: {

                Email1: {
                    required: true,
                    email: true
                }
            },
            submitHandler: function (form) {
                if (formIndex == 0) {
                    form.submit();
                    formIndex++;
                }
            }
        });
    });

</script>
<% Email obj = (Email)ViewData.Model; %>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="edit">
    <tr>
        <td class="label required">
            Địa chỉ email <span>*</span>
        </td>
        <td class="input">
            <% 
                if(obj==null) 
                    Response.Write(Html.TextBox("Email1",string.Empty, new { @maxlength = "200", @style = "width:300px" }));
                else
                    Response.Write(Html.TextBox("Email1", obj.Email1, new { @maxlength = "200", @style = "width:300px" }));                            
            %>
        </td>
    </tr>
    
    <tr>
        <td>
        </td>
        <td>
            <input type="submit" class="save" value="" alt="" id="save"/>
            <input type="button" class="cancel" value="" alt="" onclick="JS_LIB.closePopup()" />
        </td>
    </tr>
</table>